<!DOCTYPE html>  
<html lang="zh-CN">  
  <head>  
    <meta charset="UTF-8" />  
    <title>练习1</title>  
    <style type="text/css">  
      /* 设置顶部导航栏的背景颜色为黑色 */  
      #header {
          background-color: black;
          min-width: 1000px;
      }
      div a {  
        color: white; 
      }  
      div a:first-of-type { 
        background-color: green;  
      }
      div a:hover {  
        background-color: darkgray; 
        color: black; 
      } 
    </style>  
  </head>  
  
  <body>  
    <div id="header">  
      <a href="#home">主页</a>  
      <a href="#news">新闻</a>  
      <a href="#contact">联系方式</a>  
      <a href="#about">关于我们</a>  
    </div>  
  
    <div style="padding-left: 16px">  
      <h2>顶部导航实例</h2>  
      <p>信息内容..</p>  
    </div>  
  </body>  
</html>